home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-02-29 | 40.1 KB | 1,295 lines |
- This is the docs you get with the FREEWARE version of
- GAMESMITH.
-
- LEGAL STUFF - read and understand! ---------------------------------
-
- GAMESMITH is copyright 1995 by Alexander J. Russell, and Bruce S. Miller
- All rights reserved.
-
- You are allowed to use Gamesmith to create EXE files, and related
- data files (art, sprites, palettes etc...) which can then be
- distributed royalty free.
-
- NO part of the Gamesmith library, utilities, include files, object
- files, and source files may be distributed in any form, EXCEPT for
- the original ZIP file containing the full freeware version with NO
- modifications which may be distributed!
-
- Gamesmith is completely unwarranted, and is used at your own risk.
-
- ---------------------------------------------------------------------
-
- To recieve full source code write to:
-
- alexad3@icebox.iceonline.com
-
- Cost for the source code is $100.00 CDN
-
- -------------------------------------------------------
-
- Gamesmith is a library of ASM and Borland C compatible modules in the
- MEDIUM memory model, DOS real mode.
-
- Gamesmith includes powerful utilities to be used by programmers to
- quickly create a wide variety of games. Gamesmith is based on the XLIB
- xmode libraries.
-
- A copy of DPAINT II (trademark of EA) is also very useful!
-
- Who is GameSmith for?
-
- You know C and want to make real cool games. You know about
- near and far pointers. You are comfortable with pointers and structs.
- You know how to use LIBS, and how to LINK C programs.
- You don't need to know any assembler.
-
-
- If you get the source you'll want to know assembler.
- -----------------------------------------------------------
- Overview
-
-
- gui editor
- full featured gui with easy to use editor
-
- animation engine
- full featured animation engine with scaling
-
- tile-map engine
- full featured scrolling tile-map engine
- can be used in conjuction with the animation engine
-
- Debugging tools
- display debug info to an MDA monitor
- track memory use
- check for memory overwrites on all gmalloc'ed mem
- hot keys to:
- pause
- display mem in use
- display registered die functions
-
- various utilites
- see below
-
- XMS access
- easy access via functions as easy to use as fopen() etc...
-
- primitive, but fast 3d polygon support
- no editor yet, nifty, but still hard to use
-
- ------------------------------------------------------------------
-
- The borland directory contains example config files.
-
- ------------------------------------------------------------------
- Utilities
-
- This set of utilities is the heart of GAMESMITH. They do everything
- you need to do right now! Most utils will display help info if run
- with no parms.
-
- EDITGUI EXE Powerful editor to draw gui panels, see below for
- details.
- GUI_TEST EXE Test your new gui panels - works wih any file created
- by EDITGUI.exe
- EDITMAP EXE Visual tile map editor
- EDITSPR EXE Visual animation engine editor
- LISTIFF EXE List info for dpaint LBM files
- MAKE13 EXE Turn dpaint LBM/BBM files into m13 bitmaps (linear)
- MAKECBM EXE Turn dpaint LBM/BBM files into cbm bitmaps (compiled)
- MAKELIB EXE Glue data files together into a library.
- MAKEPAL EXE Extract palette info from LBM,BBM, and PCX files.
- MAKEPBM EXE Turn dpaint LBM/BBM files into pbm bitmaps (planed)
- MKANM EXE Create an anim (like a FLI file) from a series of
- LBM's. A mode 13 util.
- PLAYANM EXE Play anm files (mode 13 only)
- READBBM EXE Display LBM and BBM files
- SHOW13 EXE Display m13 files
- SHOWCBM EXE Display cbm files
- SHOWPBM EXE Display pbm files
- BITMAPB GUI Used by EDITGUI.EXE - a gui panel created with
- EDITGUI.exe.
- COLOR GUI Used by EDITGUI.EXE
- SPC EXE Compile demo script files.
- INPUT GUI Used by EDITGUI.EXE
- RECT GUI Used by EDITGUI.EXE
- SLIDER GUI Used by EDITGUI.EXE
- TEXT GUI Used by EDITGUI.EXE
- TEXTB GUI Used by EDITGUI.EXE
- MAKEPKB EXE Turn dpaint LBM/BBM files into PKB bitmaps (planed RLE)
- SHOWPKB EXE Display PKB files
- CRSHAIR CBM Default mouse cursor for many utilities
- STD PAL Default palette
- HAPPY PBM Default bitmap for new buttons
- USER5 FNT Screen font
- GLUEHORZ EXE Glue 2 m13 bitmaps together side to side (must be
- same height). Used to get around limitations of Dpaint.
- M13_2_PB EXE Convert m13 bitmaps to pbm bitmaps
- PLIST GUI Used by GUI_EXIT.EXE
- RADIO GUI Used by GUI_EXIT.EXE
- USER2 FNT Screen font
- USER3 FNT Screen font
- USER4 FNT Screen font
- TABORD GUI Used by EDITGUI.EXE
- CPUID EXE Identifiy the CPU, sets dos errorlevel for CPU type for
- use in batch files.
- PARMS GUI Used by EDITGUI.EXE
- DSRPCSHW EXE Display demo scripts compiled with spc.exe
- MAKESPR EXE Make sprite file - see animation engine docs
- CHNGEPAL EXE Change a LBM or BBM's internal palette
- PCX2PBM EXE Convert PCX file to pbm
- PCX2CBM EXE Convert PCX file to cbm
- SIZEMOUS CBM Used by EDITGUI.
-
-
- It makes life a lot easier if you add your util directory to your
- path!
-
- Details of selected utilities --------------------------------
-
- EDITGUI.EXE
-
- Create GUI panels, interface elements, quickly and easily!
- Just draw them on the screen.
-
- All gui panels have a main rectangle that all the gadgets are placed
- on. This main retangle can be invisible if you want the gadgets to
- float ontop of a nice background. Each gadget has a UNIQUE id number.
- It is possible to change the ID's, and you must be careful to make
- sure that they are UNIQUE within each panel!
-
- Gadgets that can be used:
-
- Text Text of any color, in a number of fonts.
- Text input Editable text in a input box.
- Support insert/overwrite, del, backspace, delete
- from cursor to end of line (CTRL-Y), home, end, left
- and right. Text can be numbers only, and password
- (all text is displayed as '*') as well as plain text.
- Text button Rectangular push button with hot key
- Bitmap button Rectangular button with bitmap displayed instead of
- text, also has hotkey. All buttons allow user to
- change mind by moving mouse off the button before releasing
- mouse button.
- Radio-buttons horizontal or vertaical collection of
- mutually-exclusive buttons.
- Sliders Vertical or horizontal sliders. Thumb can be dragged,
- or clicking above/below thumb moves one page.
- Pick-list Scroll box with slider for making a single selection
- from a list, or tagging mutliple selections from a
- list. Use arrow keys, home, end,page up/down or
- slider to move through list.
-
-
- Using the GUI editor.
-
- EDITGUI gui_filename [set_file_name]<ENTER>
-
- gui_file_name is an existing or new gui file. If new, a default panel
- is created with a title and two text buttons. set_file_name can be
- used to restore colour and palette preferences that were saved
- previously. If set_file_name isn't specified the default palette and
- colours are used.
-
- Moving gadgets - click on the gadget with left mouse button in the centre
- of the gadget, and drag with the left mouse button down.
-
- Sizing gadgets - click on the gadget's border (mouse cursor changes to
- a two-head pointer when on a border) and move mouse with left button
- down to size.
-
- Editing gadget parameters - click on a gadget with the right mouse
- button to display the main edit screen. The first screen is the same
- for all gadgets. Click on MORE to set gadget specfic parameters.
- Changing the GRID value to a non-zero number turns on the GRID
- function.
-
- Grid - when turned on all moving and sizing operations are limited to
- increments as defined by the grid value.
-
- ALT-C - centres text in text buttons, and text patches.
-
- F1 - displays a help screen
-
- F9 - save current gui
- F10 - save then exit.
- ESC - exit without saving.
-
-
- Test the look and feel of gui panels with GUI_TEST.EXE
- gui_test gui_file_name<ENTER>
- gui_text.exe always uses the std.pal located in the same directory as
- gui_test.exe.
-
- ID's!!!!
-
- Gadget ID's are very important. When a user clicks on a gadget it is
- the ID that is returned to your program. In large programs with many
- gui panels it is important to plan the use of id's. By default the
- editor gives each gadget a unique ID, but only unique for that file.
- It is a good idea to give each panel a set of numbers: say panel one uses
- 1 to 99, panel two 100 to 199, panel three 200 to 299 etc...
-
- Gui panels are completely re-drawn each frame. Why? So you can easily
- do special effects over or under them without worrying about updates.
-
-
- To use many gui panels without going to disk use:
-
- void gui_push(void); // save the currently displayed gui panel in a
- // stack, then you can load another
- void gui_stack_select(short num);
- // select any pushed panel, the 1st panel pushed
- // is num=0, the second is num=1 etc...
-
-
- void gui_pop(void); // remove the TOP most gui_panel from the stack
- // generally you gui_unload_gadget() first.
-
- void gui_pop_all(void); // pop_em all - also unloads them
-
-
- See below for example source.
-
- See g_io.h and gui.h also.
-
- GUI and other I/O ---------------------------------------
- EVENT types, and related data
-
- event.x and event.y are the current mouse position unless
- otherwise noted.
-
- event.type
-
- E_MOUSE_MOVE
- E_R_BUTTON_DN
- E_R_BUTTON_UP
- E_L_BUTTON_DN
- E_L_BUTTON_UP
-
- E_JOY_X_LEFT
- E_JOY_X_CENTRE
- E_JOY_X_RIGHT
- E_JOY_Y_UP
- E_JOY_Y_CENTRE
- E_JOY_Y_DOWN
- event.x, event.y - raw x,y for joystick
-
- E_B0_UP
- E_B0_DN
- E_B1_UP
- E_B1_DN
- event.x, event.y - undefined
-
- E_KEY
- event.sub_type
- E_UP
- E_DOWN
-
- event.d1 raw scan code
- event.d2 ascii code, NOTE! uses non-ascii for ALT keys
-
- E_GUI
- event.d1=gadget id
-
- event.d2 is for each gadget:
-
- button - undefined
- text - undefined
- input - undefined
- radio button - active button number from set (0...max-1)
- pick-list - plist.cursor_item, item cursor is on now
- slider - value of slider.th_top, position of thumb
-
-
-
- NOTE!
- The global array key_stat[] contains 1's for down keys, and
- 0's for up keys. Indexed by RAW scan code.
-
- ----------------------------------------------------------------------
-
- STEPS TO CREATE AND USE A SPRITE ANIMATION SEQUENCE:
- ----------------------------------------------------
- Use the following steps to create, visually fine-tune, and use
- a sprite sequence of internal animation for your programs.
-
- NOTE: You can replace any or all sprites in a compiled, working
- .exe application by simply replacing or modifying the
- sprite files. You can also fine-tune your animation at any
- time by using "EditSpr.EXE" to visually edit your sprite
- animation files. No re-compiling of your application is
- necessary.
-
- 1. Draw a sequence of bitmaps for your animated sprite character
- and save as a series of .PCX, .LBM or .BBM bitmap files.
- The names for your bitmaps should allow directory sorting
- in the correct order for your internal animation sequencing.
-
- EX: filenames for a rotating tank:
- tank001.PCX, tank002.PCX, tank003.PCX...
-
- 2. Convert the artwork files to the desired type of animation
- bitmap file. Choose from the following:
-
- .PBM - Planar BitMap file. This is used for general
- purpose planar animation, and allows for clipping.
- Medium speed for medium size shapes.
-
- .PKB - PacKed Bitmap file. This is used for fast drawing
- of large, irregular shaped objects. Erases/draws
- within shape borders to avoid drawing entire
- rectangle for large shapes. Cannot be clipped.
- Higher speed for large non-rectangular shapes.
-
- .M13 - Linear bitmap file. This is used for scaling
- (with automatic clipping).
- Lower speed, but scalable.
-
- .CBM - Compiled BitMap. This is a compiled bitmap used
- for smaller shapes where high speed is essential.
- Compiled for a particular screen resolution.
- Cannot be clipped. Large file size.
- Highest speed for small shapes.
-
- Use MakePBM.exe, MakePKB.exe, MakeM13.exe, or MakeCBM.exe.
- Can specifiy wildcards.
-
- Ex: "MakePBM tank*.PCX <CR>" produces:
- tank001.PBM, tank002.PBM, tank003.PBM...
-
- 3. Combine the animation bitmap files into a sprite animation
- sequence file using MakeSPR.exe. You can name the sprite
- file anything you wish, but .SPR is recommended.
-
- Ex: "MakeSPR tank*.PBM tank.SPR" produces: "tank.SPR".
-
- NOTE: you can also use one of the non-clipping bitmap
- types such as .PKB, and create and specify a
- second matching set of .PBM bitmaps for clipping.
- The sprite animation engine automatically switches
- to the clipping .PBM bitmaps at the edges of your
- specified clip rectangle.
-
- Ex: "MakeSPR tank*.PKB tank *.PBM tank.SPR"
- produces: "tank.SPR" with .PKB primary bitmaps, and
- .PBM clipping bitmaps.
-
- Warning: both sets of bitmaps must contain identical artwork,
- and be in the same order in your directory.
-
- 4. Fine-tune your sprite animation file using EditSPR.exe.
- See documentation for the EditSPR.exe utility.
-
- 5. Use your sprite file in your program. See source code in
- SprDemo.C for examples.
-
- --------------- WHAT IS A TILE MAP ? ----------------
-
- A tile map is a grid of bitmaps which is larger
- than the screen which forms the background for
- a game or simulation. The tile map is scrollable
- to provide the illusion of "travelling" on the map.
-
- MAP ELEMENTS:
-
- Tiles: - Small planar bitmaps which are "tiled"
- together to form the tile map.
- - Tiles can be any height or width but the
- width must be a multiple of 4.
- - All tiles in a map are the same size and
- shape.
- - Each tile has an attribute byte which
- contains bits for collision detection,
- etc.
-
- High and Low Dressings:
- - Dressings are bitmaps which overlay the
- tiles and give additional realism.
- - Dressings stay "anchored" to the map
- as it moves to give the appearance that
- they are part of it.
- - Low and high dressings are identical
- except that low dressings are drawn over
- the tiles but under any moveable game
- elements (such as sprites).
- - High dressings are drawn over sprites
- to temporarily cover them as they move.
- Example: trees which sprites can
- "hide" under.
-
- Anims: - Anims are sprites (internally animated
- bitmaps which are attached to the map
- similarly to dressings.
- - Anims are implemented with the sprite
- structures included with GAMESMITH.
-
- ELEMENT ATTRIBUTES:
-
- Each tile, dressing and anim has an "attribute"
- byte associated with it that holds 8 on/off
- settings for each tile.
-
-
- STEPS TO CREATE AND USE A TILE MAP:
- ----------------------------------
- Use the following steps to create, visually fine-tune, and use
- a scrolling tile map for your application programs.
-
- NOTE: You can replace any tile map elements, or entire
- background tile maps in a compiled, working .exe
- application by simply replacing or modifying the
- tile map files. You can also fine-tune your tile maps
- at any time by using "EditMap.EXE" to visually edit
- your tile map files. No re-compiling of your
- application is necessary.
-
- ELEMENTS:
-
- A full-blown scrolling tile map consists of 4 major elements:
-
- 1) A background tile library file
- 2) A library of dressings bitmaps file
- 3) A library of animated dressings (sprites) - Optional
- 4) A map file which ties everything together
-
- STEPS:
-
- 1. CREATE THE TILE LIBRARY
-
- a) Create the artwork file for the background tiles
-
- This artwork file will contain a single copy of each
- of the unique background tiles.
- Draw a series of unique tiles in a rectangular grid
- and save as a single .PCX file.
-
- b) Convert the artwork file to a tile library file
-
- Use the "MakeTLib.exe" utiltiy to create a tile library
- file ( an array of bitmaps) from the .PCX graphics file.
- Type "MakeTLib.exe" (with no parameters) for instructions.
-
- 2. CREATE THE "DRESSINGS" LIBRARY
-
- a) Create a ".PBM" bitmap file for each of the
- unique map dressings (see "STEPS TO CREATE AND
- USE A SPRITE ANIMATION SEQUENCE" above).
-
- b) Create the dressings library file. Combine the ".PBM"
- files together using the "MakeLib.exe" utility.
-
- 3. CREATE THE "ANIMS" LIBRARY (OPTIONAL)
-
- a) Create a ".SPR" sprite animation file for each
- of the unique anims (see "STEPS TO CREATE AND
- USE A SPRITE ANIMATION SEQUENCE" above).
-
- b) Create the anims library file. Combine the ".SPR"
- files together using the "MakeLib.exe" utility.
-
- 4. CREATE THE TILE MAP FILE
-
- Tie everything together by creating the .MAP file.
- Use the "MakeMap.exe" utility to create a specific
- size map, and tie in the other component files.
- Type "MakeMap.exe" (with no parameters) for instructions.
-
- 5. VISUALLY EDIT THE MAP
-
- Visually place and set attributes for the various elements
- of the map using the "EditMap.exe" utility.
- See documentation for the EditMap.exe utility for details.
-
- 6. USE THE MAP
-
- Use your tile map in your program. See source code in
- MapDemo.C for examples.
-
- -------------- HOW TO USE "EDIT_MAP" ----------------
-
- WORKING WITH TILES, DRESSINGS OR ANIMS:
-
- Click on one of the pusbuttons marked "Tiles",
- "High", "Low", or "Anim" to select the desired
- mode.
-
- The words "Placing Tiles(\High\Low\Anims)" will
- appear in the status window to display the current
- working mode.
-
-
- WORKING WITH TILES:
-
- Selecting tiles:
-
- Tiles are selected from the current tile group
- (or range).
-
- Select the tile that you wish to place on the
- map by:
-
- * clicking on one of tiles visible on the top menu
-
- * pressing the function key specified below the
- tile on the menu
-
- Large Tile Ranges:
- If the current tile group includes more than
- 9 tiles, an arrow pusbutton will appear to the
- left or right of the tiles on the menu.
-
- To access the tiles to the left of the visible
- range, click the left arrow pushbutton. Similarly
- for the right button.
-
- Random Tile Selection:
- Click on the "Random" pushbutton to have tiles
- selected randomly from the current group. The
- words "Random On" will appear in the status window
- on the lower right of the top menu. Click the
- pusbutton again to turn random selection off.
-
- Selecting Tile Groups:
-
- Select a tile group (or range) by clicking on the
- "Next" or "Back" pushbuttons.
-
- Tile groups may be larger than the number of tiles
- that can be displayed across the menu (see Large
- Tile Ranges - above ).
-
- Defining Tile Groups (LIB pushbutton):
-
- Tile groups are set using the tile LIBrary editor.
-
- To set the range (or change the range )for tile
- groups, click on the "Lib" button.
-
- Tiles can also be move around in the tile library
- (see the help screen in the tile library editor).
-
- Placing Tiles On The Map:
-
- To place the selected tile on the map, move the
- mouse pointer to the desired location and click
- the left mouse button. You can drag the mouse to
- place whole rows or blocks if desired.
-
- Random Tile Selection
- If the random feature is turned on, each time you
- click or drag the mouse, a tile will be randomly
- selected from the current tile group as you click
- or drag the mouse.
-
- Deleting Tiles from the Map:
-
- There is no specific delete function for tiles.
- Simply over-write the discarded tile with a new
- tile.
-
- Viewing / Setting Tile Attributes:
-
- To view tile attributes, click on the "ATTRIB"
- pushbutton. Attributes are displayed in a small
- box at the upper left corner of each tile.
- Each bit in the attibute byte is displayed as a
- white vertical "stripe" in the box.
-
- To set attributes, right mouse click the first
- tile that you wish to set. Drag the mouse to
- highlight the desired row/column or rectangle of
- tiles. Let go of the mouse button and the
- "Attributes Dialog Box" will appear. Click on
- the radio buttons for the bits that you wish to
- change. Click on the "Accept" button to apply
- the new settings to the entire selected range,
- or the "Cancel" button to leave as is.
-
- The settings from one tile can be copied to
- an entire range by selecting that tile first,
- then dragging the mouse to select the range.
- The attributes dialog box displays the settings
- for the first tile selected, which can then be
- applied to the entire range by choosing "Accept".
-
-
- WORKING WITH HIGH OR LOW DRESSINGS:
-
- Click on the pusbutton marked "High" or "Low" to
- place or delete High or Low dressings. High
- dressings are drawn over top of other map elements
- to fully or partially "hide" the elements "below".
- Low dressings are drawn over tiles, but under
- Anims and High dressings. The following sections
- applies to both High and Low dressings.
-
- Selecting Dressings:
-
- Dressings are selected from the current dressings
- group (or range) shown across the bottom of the
- menu.
-
- Select the dressing that you wish to place on the
- map by:
-
- * clicking on one of dressings visible on the menu
-
- * pressing the function key specified below the
- dressing on the menu
-
- Random Dressing Selection:
-
- Click on the "Random" pushbutton to have dressings
- selected randomly from the current group. The
- words "Random On" will appear in the status window
- on the lower right of the menu.
-
- Determining The Number of Dressings On the Map:
-
- Each time that you select a dressing, the number of
- this particular dressing currently on the map is
- displayed over the selected dressing on the menu.
-
- Selecting Dressing Groups:
-
- Select a tile group (or range) by clicking on the
- "Next" or "Back" pushbuttons.
-
- Dressing groups are simply a group of 9 bitmaps
- ( the maximum number that can be displayed
- across the menu).
-
- Defining Dressing Groups:
-
- Dressing groups are defined by the order in which
- they were specified when the bitmap "Lib" file was
- created using the MakeLib.exe utility.
-
- Placing Dressings On The Map:
-
- To place the selected dressing on the map, simply
- move the mouse pointer to the desired location and
- click the left mouse button.
-
- If the random feature is turned on, each time you
- click the mouse, a dressing will be randomly
- selected from the current tile group.
-
- Deleting Dressings From The Map:
-
- To delete a dressing from the map, choose place
- "HiDress" (for example). Now click on the "Delete"
- button. The word Delete will flash on the menu.
-
- Move the mouse pointer over the dressing that you
- wish to delete (on the map). Notice that as you
- move the pointer over each of the high dressings
- (or low dressings if you have chosen them), the
- menu displays the number of dressings of this type
- currently on the map. Click the left mouse
- button to delete the dressing.
-
- Selecting a dressing on the menu when in "delete"
- mode will display the number of that type of
- dressing on the map.
-
- Setting Dressing Attributes:
-
- When in "placing Low dressings or High dressings
- mode", click on the "Attrib" pushbutton. The
- attribute byte for each dressing will now be
- displayed at the upper left corner of each
- dressing bitmap (note that this may appear to be
- "off" the dressing if it is not rectangular).
-
- Click the right mouse button on the desired
- dressing and release to change attributes in
- much the same way as for tiles (see Setting Tile
- Attributes - above ), except it is done one
- object at a time.
-
- WORKING WITH ANIMS:
-
- Working with anims is virtually identical to
- working with high or low dressings, except
- that when you place an anim onto the map, it
- begins it's internal animation cycling.
-
- You can adjust the settings for the anims by
- using the "EditSpr.exe" visual utility on the
- individual sprite files before combining them
- into the anim library file.
-
-
- =============== EDIT TILE LIB HELP FILE =============
-
- --------------- SETTING TILE GROUPS -----------------
-
- To set tile groups to be used in editing tile maps:
-
- * Click on "Next", "Back" pushbuttons to select
- tile groups that you wish to set.
-
- * Click on the "First", "Last" input boxes and
- type in the index of the start, end tiles for
- each group.
-
-
- ------------------- MOVING TILES --------------------
-
- To exchange tiles:
-
- * Click left mouse button on first tile,
- drag to new location and release mouse button.
-
- The first tile will be exchanged with the tile
- at the location where you released the button.
-
-
-
- -----------------------------------------------------
-
- =============== EDIT SPRITE HELP FILE ===============
-
- editspr.exe
-
- --------------------- MAIN MENU ---------------------
-
-
- The main menu gives you access to the following
- editing submenus (bottom row):
-
- "O=centrOffset C=Cycle B=collideBox A=Attach"
-
-
- O=centrOffset: adjust the sprite x, y offsets to
- "centre" the sprite for each
- frame of animation.
-
- C=Cycle: cycle the sprite through it's
- internal animation, set the speed
- of animation.
-
- B=collideBox: adjust the collision rectangle
- for each frame to provide more
- accurate and realistic collision
- detection.
-
- A=Attach: set from 1 to 4 "attach" points
- for each frame of animation
- (Ex: set attach point #1 to be at
- the gun barrel of a rotating
- tank).
-
- In addition the following functions are available:
-
- "MAIN MENU T=Toggle bitmaps W=Write file"
-
- T=Toggle bitmaps:
-
- Toggle between the primary bitmaps and the
- clipping (.PBM) bitmaps if the sprite file
- contains both.
-
- Clipping bitmaps may be included if the primary
- bitmaps are of a non-clipping type such as
- packed (.PKB) bitmaps. The animation engine
- will automatically switch to the .PBM and clip
- if the sprite is at one edge of it's clip
- rectangle.
-
-
-
- W=Write file: Press 'W' to save changes to disk.
-
-
-
- --------------- OFFSET CENTER MENU ------------------
-
-
- This function is used to center each frame of the
- sprite animation.
-
-
- The intersection of the vertical and horizontal lines
- indicates the center of all frames.
-
- SPACE BAR: step through each frame of animation.
-
- LEFT, RIGHT ARROW keys: move each bitmap horizontally
- to center with the crosshair.
-
- UP, DOWN ARROW keys: move each bitmap vertically
- to center with the crosshair.
-
- ESC = exit to main menu
-
-
- ------------------ CYCLE MENU ----------------------
-
-
- This function is used to cycle the sprite through
- it's bitmaps in order to set the default speed of
- animation.
-
- 'C' : cycle Continuously
-
- 'O' : cycle Once
-
- 'F' : Faster cycling
-
- 'S' : Slower cycling
-
- SPACE BAR: stop cycling
-
- ESC: exit to main menu
-
-
- ------------- COLLISION RECTANGLE MENU --------------
-
- This function is used to set the collision rectangle
- for each frame of animation in order to get a more
- accurate and realistic collision zone.
-
-
- SPACE BAR: step through each frame of animation
-
- ARROW KEYS: move collision rectangle
-
- CTRL+ARROW KEYS: size collision rectangle
-
- ESC = exit to main menu
-
-
- ---------------- ATTACH POINTS MENU -----------------
-
- This function is used to set the attach points (1to4)
- for each frame of animation. They provide an x, y
- offset from the sprite's position for launching
- bullets, etc.
-
-
- '1' : go to Attach point #1 menu
- '2' : go to Attach point #2 menu
- '3' : go to Attach point #3 menu
- '4' : go to Attach point #4 menu
-
- ESC = exit to main menu
-
-
- ------------ ATTACH POINT#1(,2,3,4) MENU ------------
-
- This function is used to set the location (with
- respect to the sprite) of attach point#1(,2,3,4)
- for each frame of animation.
-
- SPACE BAR: step through each frame of animation
-
- ARROW KEYS: move attach point (short cross-hair)
-
- ESC = exit to main menu
-
-
- ===================================
-
-
- CPUID.EXE
-
- cpuid.exe was compiled and linked on a XT to provide maximum
- compatibility with older computers.
-
- CPUID has been tested on an XT(8086) and a 486 so far.
- CPUID sets the dos errorlevel on exit to match to processor level
- for use in batch files.
-
- 0 for 8086
- 1 for 186
- 2 for 286
- 3 for 386
- 4 for 486
- 5 for 586 (Pentium)
- etc...
-
- It also checks for a Co-Pro, but that value is not returned.
-
-
- ----------------------------------------------------------------
-
-
- // -------- Where to find info in H files
-
- Basic defines (e.g. USHORT) G_DEF.H
-
- DEBUG
-
- print to MDA (second monitor) PR2.H
- die / exit funcs DIE.H
-
- Hot keys
- CTRL-ALT-DEL Exit to Dos, do all die funcs
- CTRL-ALT-E list all exit func
- CTRL-ALT-H heap walk
- CTRL-ALT-L gmalloc list/mem overwrite
- check
- CTRL-ALT-V List events in queue
- (not terribly useful)
- CTRL-ALT-P Pause
-
- Demo Scripts DSPRC.H
- Erase rects ERASE.H
-
- Gmalloc memory allocation+ GMALLOC.H
- Quick malloc QMALLOC.H
- Used by the erase rect code
-
- Init xmode, restore prev mode PALETTE.H
-
- Input / Output
- keyboard/joystick/mouse G_IO.H
- gui basic stuff GUI.H
- gui tools GUITOOL?.H
-
- Lines Arbitrary in C LINE.H
-
- Palette loading, cycling, init xmode PALETTE.H
-
- XMS XMEM.H
-
- Every H file ---------------------------------------------------
-
- BLIT13 H Yup, some mode 13 code.
- COLORS H EGA colour defines.
- DANM H Mode13 fullscreen anims using frame-diff coding.
- DEMO H Just for the demo.
- DIE H Improved on exit functions.
- DSPRC H Demo scripts stuff.
- ERASE H Auto erase rects for page flipping code.
- FSTRING H Before Borland 3.1 used these.
- G_DEF H USHORT BYTE and other defines.
- G_IO H Keyboard/joystick/mouse i/o.
- GMALLOC H Fancy malloc with node names, sizes, and mem
- overwrite checking.
- GSOUND H Lame sound, really just a place holder.
- GTIMER H Speed up the timer etc...
- GUI H All the main GUI stuff.
- LINE H C arbitrary lines, frame by frame - used to move
- objects along straight lines.
- PALETTE H Palette stuff, and init xmode.
- POLYGON H Polygon stuff - not easy to use, but FAST.
- PR2 H Output like printf() to an MDA.
- QMALLOC H Used to quickly allocate mem from a pool. Much FASTER
- than malloc, but can't free individual items.
- READG H Read a file buffered from XMS if inited, else from
- disk.
- READLBM H Read a Dpaint TM LBM file and convert to linear bitmap.
- SPRFILE H Animation engine.
- SPRBANK H Animation engine.
- SPRITE H Animation engine.
- XMEM H Easy to use XMS stuff.
- XPACKBM H Our RLE planar bitmaps - faster than normal masked
- bitmaps.
- XSCALE H Scale Linear bitmaps and display in xmode - FAST.
-
-
- All these are the original XLIB includes for all your basic drawing
- functions.
-
- XBEZIER H Bezier curves - I never used them, but you might.
- XBMTOOLS H Make PBM,CBM etc... Our make???.EXE utils use this.
- XCBITMAP H Compiled bitmaps.
- XCIRCLE H circles!
- XCLIPPBM H Clipped PBM's
- XCOMPPBM H make cbm's
- XDETECT H detect mouse, video card, CPU
- XFILEIO H file io, doesn't use fopen()
- XLINE H draw lines
- XPAL H Use the code in palette.h - its faster
- XPBITMAP H PBM drawing
- XPBMCLIP H more clipped PBm's
- XPOINT H draw a pixel, get a pixel
- XRLETOOL H a generic RLE func
- XVBITMAP H hybrid sprites half in vid mem/half in conv mem
- XMOUSE H Use G_IO.H and GUI.H instead
- XLIB H xlib defines, and startup code, use the init_xmode in
- palette.h NOT xlib.h
- XLIB_ALL H Includes all the xlib includes
- XTEXT H Fast easy text
- XRECT H fast filled and patterned rectangles
-
-
-
- ------------------ source examples -----------------------------------
-
-
- /*
-
-
- Example of Include files, and stuff you just have to have in every program
-
- testa.c
-
- Internet: alexad3@icebox.iceonline.com
- Copyright 1995, April 14 by Alec Russell, ALL rights reserved
-
- Created - 1995/4/14
-
- A silly little demo of basic GameSmith stuff
-
- History:
- New file
-
- */
-
- #include <stdio.h>
-
- #include <pr2.h> // for debug display
- #include <g_def.h> // standard types eg ULONG, BYTE, USHORT
- #include <palette.h> // palette loading, init xmode
- #include <g_io.h> // i/o
- #include <gui.h> // if you use the gui you need this
- #include <erase.h> // for erase rects
- #include <die.h> // clean death code
- #include <gmalloc.h> // if you gmalloc any mem
- #include <gtimer.h> // speed up timer for smoother animation
-
- #include <Xlib_all.h> // all basic drawing functions
-
-
- /* ---------------------- main() ------------------------- April 28,1993 */
- void main(void)
- {
- short done;
-
- clear_pr2(); // clear MDA screen for debug out-put
-
- init_exit(); // init all die related code, MUST be first!
- init_mem_list(); // neccessary or will crash!!!! MUST be next
- init_xmode_video(); // enter xmode, MUST precede init_events()
- // 360x320 256 color, page-flipping enabled
- init_timer(); // speed up timer, required for fades
-
- /* set palette - highly reccomended to load your own palette */
- pr2("loading palette"); // pr2() prints to a MDA - just like printf()
- if ( load_palette("small.pal", palette) ) // this doesn't set it
- die("error getting palette");
- // don't use exit - use die()! It automaticly
- // cleans up, restores ISR's, and previous vid mode.
- setvgapalette(palette);
-
- pr2("init events and load mouse");
- /* intit all i/o code, install keyboard handler, auto-calibrate
- joystick, loads mouse pointer bitmap also
- the mouse pointer MUST be a cbm type bitmap
- */
- init_events("crshair.cbm"); // this must be AFTER init_xmode_video()
-
- // REQUIRED - mouse drawing code requires this even if you
- // don't call add_erase_rect()
- /* set aside mem etc.. for 4 erase rects, not to exceed 2k */
- init_gb_erase(4, 2000);
-
- page=0; // I'm just paranoid
- done=0;
-
- while ( !done )
- {
- /* erase old stuff */
- draw_erase_rects(&(gb_h[page]));
-
-
- /* draw your stuff here */
- /* handle gui stuff here */
- /* yup, this where all your very own cool code goes! */
-
-
- /* draw the mouse - always the last thing drawn */
- gui_draw_mouse();
-
- x_page_flip(PhysScrnXOffs, PhysScrnYOffs);
- page= page ? 0 : 1;
- }
-
- deinit_timer();
- deinit_gb_erase(); // free up the mem in use
- deinit_events(); // restore normal keyboard handler (BIOS)
- deinit_xmode_video(); // return to previos video/text mode
- }
-
- // so just copy the above into your own file and go for it.
-
-
- **********************************************************************
- **********************************************************************
-
-
- /*
-
- Example of using the GUI
-
- Copyright 1993, Alec Russell, ALL rights reserved
-
- FILE : gui_test.c
-
- graphic gui-editor panel tester
-
- Also a good example of using the gui and lib
-
- HISTORY:
- created : june 4, 1993
- updates :
-
- */
-
- #include <stdio.h>
- #include <alloc.h>
- #include <string.h>
-
- #include <g_def.h>
- #include <gui.h>
- #include <g_io.h>
- #include <palette.h>
- #include <erase.h>
- #include <gsound.h>
-
- #include <xlib_all.h>
-
- char gui_path[128];
-
- // add the gui_path to a file name
- /* ---------------------- get_gui_path() -------------- February 21,1994 */
- char *get_gui_path(char *f)
- {
- static char gui_p[128];
-
- strcpy(gui_p, gui_path);
- strcat(gui_p, f);
-
- pr2("load gui_p = %s", gui_p);
-
- return(gui_p);
- }
-
- // get the directory the exe was run from
- /* ---------------------- set_gui_path() -------------- February 21,1994 */
- void set_gui_path(char *p)
- {
- strcpy(gui_path, p);
- p=gui_path;
- while ( *p++ )
- ;
-
- while ( *p != '\\' )
- p--;
-
- p++;
- *p=0;
-
- pr2("ORG gui path = %s", gui_path);
- }
-
-
- /* ---------------------- main() --------------------------- May 25,1993 */
- void main(int argc, char *argv[])
- {
- short done=0, i;
- event_t event;
-
- clear_pr2();
- pr2("at the top");
-
- printf("GUI_TEST - v1.0 Copyright 1993 Alec Russell, all rights reserved\n");
- printf("Press a key\n");
- getch();
-
- if ( argc < 2 )
- {
- printf("USE - gui_test guifile<ENTER>\n");
- exit(1);
- }
-
- init_mem_list(); // this has to be done or gmalloc crashes
-
- set_gui_path(argv[0]);
-
- // load the gadget, and make current
- pr2("load gadget...");
- if ( gui_load_gadget(argv[1], gui_path) )
- {
- printf("ERROR loading: %s\n", argv[1]);
- exit(1);
- }
-
- // look for lists, and init them
- for ( i=1; i < gui_list.num_gadgets; i++ )
- {
- if ( ((gui_rect_t *)gui_list.gadget[i])->type == GUI_PLIST )
- {
- pr2("init plist at %d", i);
- gui_init_plist_file(((gui_plist_t *)gui_list.gadget[i]),
- get_gui_path("list.txt"));
- }
- }
-
- init_xmode_video();
-
-
- // the mouse pointer MUST be a CBM
- init_events(get_gui_path("crshair.cbm"));
-
- load_palette(get_gui_path("std.pal"), palette);
- setvgapalette(palette);
-
- // make sure this is AT LEAST large enough for the mouse pointer!
- /* set aside mem etc.. for 4 erase rects, not to exceed 16k */
- init_gb_erase(4, 16000); // 16k is overkill in this case
-
- page=0;
-
- while ( !done )
- {
- /* erase old stuff */
- draw_erase_rects(&(gb_h[page]));
-
- // you could add code here to have stuff happening UNDER the
- // gui
-
- event.d2=0;
- if ( gui_do_gadget(&event) ) // this re-draws the gui as well
- {
- switch ( event.type )
- {
- case E_GUI:
- pr2("gui id = %d curr_gadget = %d d2 = %d", event.d1, gui_list.num, event.d2);
- break;
-
- case E_KEY:
- if ( event.d2 == ESC )
- done=1;
- break;
-
- }
- }
-
- // you could add stuff here to draw OVER the gui
-
- /* draw the mouse - does erase rect stuff automaticly */
- gui_draw_mouse();
-
- /* page flip */
- x_page_flip(PhysScrnXOffs, PhysScrnYOffs);
- page= page ? 0 : 1; // page is used by the erase rect code
- }
-
- gui_unload_gadget(); // free up mem
- deinit_events();
- deinit_gb_erase(); // free up the mem in use
- deinit_xmode_video(); // restore previous vid mode
-
- }
-
-
- /* ------------------------------ EOF -------------------------------- */
-
-
-